package com.ganbo.mybatis.controller;

import com.ganbo.mybatis.entity.User;
import com.ganbo.mybatis.service.UserService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author：ganbo
 * @Date：2024/8/10 12:24
 */

@RestController
@RequiredArgsConstructor
public class UserController {

    private final UserService userService;

    @GetMapping("/user/{id}")
    public User getById(@PathVariable("id") Long id) {
        return userService.getById(id);
    }
}
